<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="application/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="root">
    <!-- 组件标签 -->
    <myschool></myschool>
</div>
</body>
<script type="application/javascript">
    //组件创建
    //组件配置中this指向VueComponent
    //new Vue this指向Vue实例
    const school = Vue.extend({
        template: `
          <div>
          组件内
          </div> `,
        data() {
            //return：避免组件被复用时，数据存在引用关系
            return {
                schoolName: '学校A',
                address: 'aaaaa',
            }
        }, //组件的嵌套
        components: {}
    })
    //注册组件
    new Vue({
        el: '#root',
        components: {
            //小写
            myschool: school
        }
    })
    //全局注册组件
    Vue.component('school', school)
</script>
</html>